function initEditor(id) {
  var upload_url = document.getElementById(id).getAttribute('upload_url');
  //console.log(upload_url,'upload_url');
  KindEditor.ready(function(K) {
    K.create('#'+id, {
      resizeType : 1,
      allowPreviewEmoticons : false,
      allowImageUpload : true,
      uploadJson:upload_url,
      items : [
        'source', '|', 'undo', 'redo', '|', 'cut', 'copy', 'paste',
        'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
        'superscript', 'clearhtml', 'selectall', '/',
        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',
        'insertfile', 'table', 'hr', 'pagebreak',
        'anchor', 'link', 'unlink'],
        afterFocus: function () {
          this.sync()
        },
        afterBlur: function () {
          this.sync()
        },
        afterChange: function () {
          this.sync()
        }
    });
  });
}